<?php
	
	class Show{
		public function run(){
			$link=mysqli_connect('localhost', 'root', 'root', 'test') or die('链接失败');
			mysqli_set_charset($link, 'utf8');
			$sql="select * from t1";
			$re=mysqli_query($link, $sql) or die(mysqli_error($link));
//			$row=mysqli_fetch_all($re);
//			var_dump($row);
			echo "<table>";
			echo "<tr><td>姓名</td><td>密码</td></tr>";
			while ($row=mysqli_fetch_assoc($re)) {
				echo "<tr><td>$row[t1_name]</td><td>$row[t1_password]</td></tr>";
			};
			echo "</table>";
		}
	}
	
	$s=new Show;
	$s->run();
?>